<div class="btn-group">
    <a href="controller.php?practice_settings&{$TOP_ACTION}document_category&action=list" onclick="top.restoreSession()" class="btn btn-default btn-edit" >
        {xl t='Edit Categories'|escape:'html'}
    </a>
    <a href="#" onclick="submit_documents();" class="btn btn-default btn-update" target="_self" onclick="top.restoreSession()">
        {xl t='Update files'|escape:'html'}
    </a>
</div>
<input type="hidden" name="process" value="{$PROCESS|escape:'html'}" /><br><br>

<form name="queue" method="post" action="{$FORM_ACTION}" onsubmit="return top.restoreSession()">
<table class="table table-responsive table-striped">
	<tr class="center_display">
		<td colspan="6">{$messages}</td>
	</tr>
	<tr class="showborder_head">
		<th colspan="2" width="110px">{xl t='Name'|escape:'html'}</td>
		<th width="100px">{xl t='Date'|escape:'html'}</td>
		<th width="200px">{xl t='Patient'|escape:'html'}</td>
		<th colspan="2">{xl t='Category'|escape:'html'}</td>
	</tr>
	{foreach name=queue_list from=$queue_files item=file}
	<tr>
		<td><input type="checkbox" name="files[{$file.document_id}][active]" value="1" {if is_numeric($file.patient_id)}checked{/if}></td>

		<td><a href="{$file.web_path}" onclick="top.restoreSession()">{$file.filename|escape:'html'}</a><input type="hidden" name="files[{$file.document_id|escape:'html'}][name]" value="{$file.filename|escape:'html'}"></td>

		<td>{$file.mtime|escape:'html'}</td>

		<td><input type="text" name="files[{$file.document_id|escape:'html'}][patient_id]" size="5" value="{$file.patient_id|escape:'html'}"><input type="hidden" name="patient_name" value=""></td>

		<td><a href="javascript:{literal}{}{/literal}" onclick="top.restoreSession();var URL='controller.php?patient_finder&find&form_id=queue{"['files[`$file.document_id`][patient_id]']"|escape:"url"}&form_name=patient_name'; window.open(URL, 'queue', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=450,height=400,left = 425,top = 250');"><img src="images/stock_search-16.png" border="0"</a>&nbsp;&nbsp;&nbsp;</td>
		<td><select name="files[{$file.document_id}][category_id]">{$tree_html_listbox}</select></td>

	</tr>
	{foreachelse}
	<tr height="25" class="center_display">
		<td colspan="6">{xl t='No Documents Found'|escape:'html'}</td>
	</tr>
	{/foreach}

</table><br><br>

</form>

{literal}
<head>
<script language="javascript">
function submit_documents()
{
    top.restoreSession();
    document.queue.submit();
}
</script>
</head>
{/literal}
